package com.test.jd;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.PostConstruct;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.song.jd.shiro.bean.UrlFilter;


@Service
public class UrlFilterService {

    @Autowired
    private ShiroFilerChainManager shiroFilerChainManager;
    
    
    public List<UrlFilter> findAll() {
        return null;
    }
    
    @PostConstruct
    public void initFilterChain() {
    	List<UrlFilter>  urls = new ArrayList<UrlFilter>();
    	
//    	UrlFilter u1 = new UrlFilter();
//    	u1.setUrl("/test/role1.do");
//    	u1.setRoles("1");
//    	u1.setPermissions("user");
//    	
//    	UrlFilter u2 = new UrlFilter();
//    	u1.setUrl("/login/doLogin.do");
//    	u1.setRoles("1");
//    	u1.setPermissions("user");
//    	
//    	
//    	urls.add(u1);
//    	urls.add(u2);
        shiroFilerChainManager.initFilterChains(urls);
    }
}
